#     Goblinoid: Experience all of MediaGoblin on an Android Device
#     Copyright (C) 2015 Dylan Jeffers 
# 
#     This program is free software: you can redistribute it and/or modify
#     it under the terms of the GNU General Public License as published by
#     the Free Software Foundation, either version 3 of the License, or
#     (at your option) any later version.
# 
#     This program is distributed in the hope that it will be useful,
#     but WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#     GNU General Public License for more details.
# 
#     You should have received a copy of the GNU General Public License
#     along with this program.  If not, see <http://www.gnu.org/licenses/>.

#:import utils kivy.utils


<GoblinBar@AnchorLayout>:
    id: goblin_bar
    anchor_y: 'top'
    size_hint_y: None
    height: sp(30)
    color: utils.get_color_from_hex("#86D4B1")
    BoxLayout:
        id: b_layout
        canvas.before:
            Color:
                rgba: goblin_bar.color if goblin_bar.color else [0, 0, 0, 0.1]
            Rectangle:
                pos: self.pos
                size: self.size
        padding: [0,0,sp(15),0]
        BoxLayout:
        Image:
            size_hint: None, None
            height: sp(30)
            width: sp(100)
            valign: 'middle'
            source: 'images/mediagoblin_large.png'
            allow_stretch: True
        BoxLayout:


<OptionsButton>:
    group: 'options'
    background_normal: ''
    background_down: ''
    # 'atlas://data/images/defaulttheme/button'
    background_color: utils.get_color_from_hex("#86D4B1")
    allow_no_selection: False 
    Image:
        id: icon
        source: root.state_normal_source
        size_hint_y: None
        height: root.height - sp(10)
        x: root.x + (root.width / 2 - self.width / 2)
        y: sp(5)


<ButtonDivider@Widget>:
    size_hint_x: None
    width: sp(2)
    canvas:
        Color:
            rgba: 0,0,0,0.05
        Rectangle:
            pos: self.pos
            size: self.size


#options bar allows for easy navigation between app's main screens
<OptionsBar>:
    anchor_y: 'bottom'
    size_hint_y: None
    height: sp(60)
    BoxLayout:
        cols: 3 
        OptionsButton:
            id: feed
            # text: 'Feed'
            state: 'down'
            on_release: root.pressed = 'feed';
            state_normal_source: 'images/feed_icon_normal.png'
            state_down_source: 'images/feed_icon_down.png'
        OptionsButton:
            id: upload
            group: 'options'
            # text: 'Upload'
            on_release: root.pressed = 'upload';
            state_normal_source: 'images/upload_icon_normal.png'
            state_down_source: 'images/upload_icon_down.png'
        OptionsButton:
            id: profile
            group: 'options'
            # text: 'Profile'
            on_release: root.pressed = 'profile'
            state_normal_source: 'images/profile_icon_normal.png'
            state_down_source: 'images/profile_icon_down.png'


<ActionLayout>:
    asm: asm
    BoxLayout:
        orientation: 'vertical'
        GoblinBar:
            id: goblin_bar
        ScreenManager:
            id: asm
        OptionsBar:
            id: options_bar
            on_pressed: root.open_action_view(self.pressed)
